<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <title>运行评价系统</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <script th:src="'/quickJs/scripts/jquery/jquery-3.1.1.min.js'"></script>
    <script th:src="'/quickJs/scripts/common/quick-remote.js'"></script>
    <link th:href="'/quickJs/styles/bootstrap/3.3.7/css/bootstrap.min.css'" rel="stylesheet">
    <script th:src="'/quickJs/styles/bootstrap/3.3.7/js/bootstrap.min.js'"></script>
    <script th:src="'/quickJs/scripts/jquery/plug-ins/layer/layer.js'" class="layer"></script>
    <script th:src="'/quickJs/scripts/common/quick-utils.js'"></script>
    <script th:src="'/quickJs/scripts/common/StringUtils.js'"></script>
    <script th:src="'/quickJs/scripts/common/quick-alert.js'"></script>
    <script th:src="'/quickJs/scripts/common/quick-version.js'"></script>
    <style type="text/css">
        table.from_table {
            border-spacing: 1px;
            border-collapse: inherit;
            background-color: #c0c0c0;
            width: 100%;
        }

        td {
            background-color: #fff;
            line-height: 40px;
            padding: 5px 10px;
        }

    </style>
    <script type="text/javascript">

        var params = {};
        $(function () {
            var formId = $.QuickUrlUtils.getRequest("formId");
            if (!StringUtils.isEmpty(formId)) {
                $.QuickRemote.AjaxJson("/tjfx/formPz/queryForm", function (form) {
                    var content = form.content;
                    var sql = form.sql;
                    content = decodeURIComponent(content);
                    params.sql = sql;
                    $("#formHeightContainer").html(content);
                    $(".wapper_container").removeClass("alert-info");
                    $("#formContainer").removeAttr("style");
                    init(params);
                }, {formId: formId});
            }
        });

        function init(params) {
            $.QuickRemote.AjaxJson("/tjfx/sqlExecuter/queryBySql", function (result) {
                if("true" == result["state"])
                {
                    $(".from_table").find("[field]").each(function (i,j) {
                        var data = JSON.parse(result["data"])[0];
                        if(typeof(data[$(this).attr("field")]) != "undefined"){
                            $(this).html(data[$(this).attr("field")])
                        }
                    });
                }
            }, params);
        }
    </script>
</head>
<body class="container">
<div class="row">
    <div id="formHeightContainer">

    </div>
</div>
</body>
</html>